<%--
  Created by IntelliJ IDEA.
  User: TianyuChen
  Date: 2020/3/12
  Time: 16:23
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
  String path = request.getContextPath();
  String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<html>
  <head>
    <title>download</title>
    <base href="<%=basePath%>">
  </head>
  <body>
    <h1>文件下载</h1>
    <h3>1 链接方式：能打开就打开，不能打开就下载</h3>
    <%-- 注意files目录要在配置文件中放行！--%>
    <a href="files/text.txt">text.txt</a><br/>
    <a href="files/text.rar">text.rar</a><hr/>

    <h3>2 设置下载方式：不管能不能打开都下载</h3>
    <a href="download?fileName=text.txt">text.txt</a>

  </body>
</html>
